package com.sk.sqd;

public class HandlerClient {

    public static void main(String[] args) {
        // 组装责任链
        ConcreteHandlerA concreteHandlerA = new ConcreteHandlerA();
        ConcreteHandlerB concreteHandlerB = new ConcreteHandlerB();
        DefaultHandler defaultHandler = new DefaultHandler();
        concreteHandlerA.setSuccessor(concreteHandlerB);
        concreteHandlerB.setSuccessor(defaultHandler);

        int[] requests = {-1, 0, 1, 11, 15, 19};

        for (int request : requests) {
            concreteHandlerA.handlerRequest(request);
        }

    }

}
